package Wlecome;

abstract class Animal {
	 void cry() {
		 
	 }
     String getAnimalName() { 
    	 return "";
    	}
}
class Dog extends Animal{
	void cry() {
		System.out.println('汪');
	}
    String getAnimalName() {  
        return "狗";  
    }
}
class Cat extends Animal {
	void cry() {
		System.out.println('喵');
	}
    String getAnimalName() {  
        return "猫";  
    }
}
class Simulator{
    public void playSound(Animal animal) {  
        System.out.println("动物种类: " + animal.getAnimalName());  
        animal.cry();
}
}
public class Application {  
    public static void main(String[] args) {  
        Simulator simulator = new Simulator();  
          
        Animal Dog = new Dog();  
        simulator.playSound(new Dog()); 
          
        Animal Cat = new Cat();  
        simulator.playSound(new Cat());  
    }  
}
